#include <iostream>

using namespace std;

int main(int argc, char *argv [])
{
	int N, Q;
	scanf("%d %d", &N, &Q);

	int *A = new int[N];
	for (int i = 0; i < N; i++) {
		scanf("%d", A + i);
	}

	char op[2];
	int start, end, c;
	long long sum = 0;
	for (int i = 0; i < Q; i++) {
		sum = 0;
		scanf("%1s", op);
		if (op[0] == 'Q') {
			scanf("%d %d", &start, &end);
			for (int j = start - 1; j <= end - 1; j++) {
				sum += A[j];
			}
			printf("%I64d\n", sum);
		} else {
			scanf("%d %d %d", &start, &end, &c);
			for (int j = start - 1; j <= end - 1; j++) {
				A[j] += c;
			}
		}
 	}
	return 0;
}